1) Field of the Invention
The present invention relates to a packet transmission system for transmitting a packet between hosts through a router. The present invention also relates to a router and a host used in such a packet transmission system. The present invention further relates to a semiconductor device which is used in the router for realizing desired functions in the router.
2) Description of the Related Art
As a result of the recent progress in computerization, LANs (Local Area Networks) have been constructed in a great number of companies, regardless of their size. Further, since the Internet has been rapidly popularized, home use of LANs is spreading.
When LANs are constructed, devices for transferring packets, such as hubs, L2 (layer 2) switches, routers, and L3 (layer 3) switches, are indispensable constituents of the LANs. In particular, hubs and L2 switches are used only inside respective LANs. The hub is such a device that when a packet is input through one port of a hub, the packet is output from all of the other ports of the hub. Often, each hub also has a function of a repeater. The L2 switch is such a device that when a packet is input through one port of a L2 switch, the L2 switch refers to a link-layer address (MAC address, e.g., Ethernet address), and outputs the packet from one of ports corresponding to the link-layer address. The MAC address is defined in for example, in a LAN in accordance with Ethernet (which is a registered trademark of Xerox Corporation). The router or L3 switch connects a LAN with an external WAN (Wide Area Network), or connects different LAN segments. That is, basically, the router or L3 switch selects a path based on a network-layer address (i.e., IP address). The IP address is defined in the network layer in accordance with the Internet protocol. In this specification, the term “router” is used to refer to either of the router and the L3 switch.
FIG. 11 is a diagram illustrating an example of a configuration of a conventional packet transmission system. In the configuration of FIG. 11, hosts 10 to 12 are connected with each other through an L2 switch 13, and transmit and receive packets. The hosts 10 to 12 belong to an identical subnetwork. The L2 switch 13 receives a packet from one of the hosts 10 to 12, and outputs from one of ports corresponding to a destination of the packet, so that the packet is transferred to the destination among the hosts 10 to 12.
An example of an operation of the conventional packet transmission system of FIG. 11 is explained below. In this example, the host 10 sends a packet to the host 12.
First, the host 10 acquires an IP address of the host 12 as a destination host, and determines an MAC address of the host 12 by referring to an ARP (Address Resolution Protocol) table. An example of an ARP table provided in each host in the configuration of FIG. 11 is illustrated in FIG. 12. In the ARP table of FIG. 12, a MAC address and an IP address of the host 11 and the MAC address and the IP address of the host 12 are stored. Thus, the host 10 acquires the MAC address “bbbbbbbbbbbb” corresponding to the IP address “192.177.2.1” of the host 12 from the ARP table of FIG. 12. Then, the host 10 inserts the IP address and the MAC address acquired from the ARP table, as a destination IP address and a destination MAC address, in a header of the packet, and transmits the packet to the L2 switch 13.
The L2 switch 13 receives the packet transmitted from the host 10, and extracts the destination MAC address from the packet. In this example, the MAC address “bbbbbbbbbbbb” is extracted. Next, the L2 switch 13 refers to a path table as illustrated in FIG. 13, and determines a port corresponding to the extracted MAC address. FIG. 13 is a diagram illustrating an example of the path table provided in the L2 switch 13 in FIG. 11. In the path table of FIG. 13, MAC addresses and corresponding port numbers are stored. Since, in this example, the extracted MAC address is “bbbbbbbbbbbb”, the port number “3” is obtained from the path table. That is, the port to which the port number “3” is assigned is connected to the host 12. Thereafter, the L2 switch 13 outputs the packet from the port to which the port number “3” is assigned, and thus the packet is transmitted to the host 12.
When the host 12 receives the packet, the host 12 extracts the destination MAC address from the packet. When the extracted MAC address is identical to the MAC address of the host 12, the host 12 captures the received packet. In all other cases, the host 12 discards the received packet. Since, in this example, the MAC address included in the received packet is identical to the MAC address of the host 12, the host 12 captures the received packet.
Thus, the transfer of the packet from the host 10 to the host 12 is completed.
FIG. 14 is a diagram illustrating an example of a configuration of a conventional packet transmission system which includes a router.
In the configuration of FIG. 14, the hosts 10 to 12 are connected with each other through the L2 switch 13 so that packets are transmitted between the hosts 10 to 12, which belong to an identical subnetwork. The L2 switch 13 transfers each packet transmitted from one of the hosts 10 to 12, to another of the hosts 10 to 12 or a router 14. In addition, the L2 switch 13 transfers each packet transmitted from the router 14, to one of the hosts 10 to 12.
Similarly, the hosts 16 to 18 are connected with each other through the L2 switch 15 so that packets are transmitted between the hosts 16 to 18, which belong to an identical subnetwork. The L2 switch 15 transfers each packet transmitted from one of the hosts 16 to 18, to another of the hosts 16 to 18 or the router 14. In addition, the L2 switch 15 transfers each packet transmitted from the router 14, to one of the hosts 16 to 18.
When the router 14 receives a packet transferred from the L2 switch 13 or the L2 switch 15 through a corresponding port, and the router 14 outputs the packet from a port corresponding to information included in the header of the packet.
FIG. 15 is a diagram illustrating an example of a construction of the conventional router 14 used in the conventional packet transmission system of FIG. 14. The router 14 comprises input/output ports 14a to 14c, a destination-MAC-address extraction unit 14d, a destination-MAC-address comparison unit 14e, a destination-IP-address extraction unit 14f, a path table 14g, an ARP table 14h, a TTL (Time To Live) reduction unit 14i, a MAC-address replacement unit 14j, and a CRC (Cyclic Redundancy Check) re-calculation unit 14k. 
The input/output ports 14a to 14c are provided for receiving and outputting packets. In the example of FIG. 14, input/output ports 14a and 14c are respectively connected to the L2 switches 13 and 15. The destination-MAC-address extraction unit 14d extracts a destination MAC address from a header in a packet received through one of the input/output ports 14a to 14c. The destination-MAC-address comparison unit 14e compares the MAC address of the router 14 with the MAC address extracted by the destination-MAC-address extraction unit 14d, and determines whether or not the received packet is addressed to the router 14. The destination-IP-address extraction unit 14f extracts a destination IP address from a header in a packet received through one of the input/output ports 14a to 14c. The path table 14g is a table storing IP addresses of subnetworks and port numbers corresponding to the IP addresses. An example of the path table 14g is indicated in FIG. 16. The ARP table 14h is a table storing IP addresses of hosts and MAC addresses corresponding to the IP addresses. An example of the ARP table 14h is indicated in FIG. 17. The TTL reduction unit 14i reduces a TTL value included in a header in a packet when the packet is transmitted from the router 14, and discards the packet when the TTL value becomes zero. When the destination-MAC-address comparison unit 14e determines that the received packet is addressed to the router 14, the MAC-address replacement unit 14j replaces the destination MAC address in the packet with a MAC address of a destination host. The CRC re-calculation unit 14k re-calculates a CRC code in the packet in which the destination MAC address is replaced by the MAC-address replacement unit 14j, and inserts the CRC code in the packet. The CRC code is provided for checking whether or not data is correctly transmitted.
An example of an operation of the conventional packet transmission system of FIG. 14 is explained below. In this example, the host 10 sends a packet to the host 16, and the hosts 10 and 16 belong to different subnetworks.
First, the host 10 acquires an IP address of the destination host 16. In this example, the IP address “192.177.2.1” is acquired. Next, the host 10 calculates a subnet address of the destination by using a subnet mask. Specifically, the host 10 calculates the subnet address as a logical product of the IP address “192.177.2.1” of the host 16 and the subnet mask “255.255.255.0”. In this example, the subnet address “192.177.2.0” is obtained. Next, the host 10 compares the subnet address with the IP address of the host 10, and determines whether or not the destination host 16 belongs to the same subnetwork as the host 10. Since, in this example, the subnet address of the host 10 is “192.177.1.0”, and the subnet address of the host 16 is “192.177.2.0”, the host 10 determines that the hosts 10 and 16 belong to different subnetworks. In this case, the host 10 inserts the MAC address “cccccccccccc” of the router 14, instead of the MAC address of the host 16, in a header of the packet as a destination MAC address. In addition, the host 10 inserts the IP address “192.177.2.1” of the host 16 in the header as a destination IP address. Further, a TTL value and a CRC code are calculated and inserted in the header. Thereafter, the host 10 transmits the packet to the L2 switch 13.
The L2 switch 13 receives the packet from the host 10, extracts the destination MAC address from the header of the packet, and recognizes that the packet is addressed to the router 14. Therefore, the L2 switch 13 outputs the packet from a port which is connected to the router 14.
The router 14 receives the packet, extracts the destination MAC address from the packet, and determines whether or not the received packet is addressed to the router 14. When the received packet is addressed to the router 14, first, the router 14 reduces the TTL value included in the header by “1”. Subsequently, the router 14 extracts the destination IP address “192.177.2.1” from the header of the packet, and calculates a logical product of the extracted destination IP address “192.177.2.1” and the subnet mask “255.255.255.0” in order to obtain a subnet address. Next, the router 14 refers to the path table illustrated in FIG. 16, and determines a port number corresponding to the subnet address obtained as above. Since, in this example, the destination IP address is “192.177.2.1”, the subnet address “192.177.2.0” and the port number “2” are obtained. Thereafter, the router 14 refers to the ARP table illustrated in FIG. 17, and acquires a MAC address corresponding to the destination IP address, and replaces the destination MAC address in the packet with the MAC address corresponding to the destination IP address. Since, in this example, the destination IP address is “192.177.2.1”, the MAC address “bbbbbbbbbbbb” is obtained corresponding to the destination IP address, and replaces the destination MAC address in the packet. Next, the CRC code for the packet is re-calculated and inserted in the packet. Finally, the packet is output from the port having the determined port number “3”.
The L2 switch 15 receives the packet output from the router 14, extracts the destination MAC address from the header of the received packet, and recognizes that the packet is addressed to the host 16. Thus, the packet is output from a port to which the host 16 is connected.
The host 16 receives the packet output from the L2 switch 15, and extracts the destination MAC address from the header of the received packet. Then, the host 16 compares the extracted destination MAC address with the MAC address of the host 16, and recognizes that the received packet is addressed to the host 16. Therefore, the host 16 captures the received packet.
As described above, a packet can be transferred through a router between hosts belonging to different subnetworks.
FIG. 18 is a flow diagram illustrating an example of a sequence of operations performed by each of the hosts in the conventional packet transmission system of FIG. 14 when the host as a source host transmits a packet addressed to another host as a destination host.
In step S10, the source host acquires an IP address of the destination host. In step S11, the source host calculates a logical product of the acquired IP address and a subnet mask “255.255.255.0” in order to obtain a subnet address. In step S12, the source host determines whether or not the destination host belongs to the same subnetwork as the source host. When yes is determined in step S12, the operation goes to step S14. When no is determined in step S12, the operation goes to step S13. In step S13, the source host adopts the MAC address of the router 14 as a destination MAC address. In step S14, the source host adopts the MAC address of the destination host as a destination MAC address. In step S15, the source host adopts the IP address of the destination host as a destination IP address. In step S16, the source host inserts the destination IP address and the destination MAC address in a header of the packet. In step S17, the source host calculates a TTL value and a CRC code, and inserts the TTL value and the CRC code in the header of the packet. In step S18, the source host transmits the packet. Thus, the source host can transmit the packet addressed to a destination host.
FIG. 19 is a flow diagram illustrating an example of a sequence of operations performed by the router in the conventional packet transmission system of FIG. 14 when the router transfers a packet.
In step S20, the router 14 receives a packet through an input/output port. In step S21, the destination-MAC-address extraction unit 14d in the router 14 extracts a destination MAC address from a header in the received packet. In step S22, the destination-MAC-address comparison unit 14e in the router 14 compares the extracted destination MAC address with the MAC address of the router 14, and determines whether or not the received packet is addressed to the router 14. When yes is determined in step S22, the operation goes to step S24. When no is determined in step S22, the operation goes to step S23. In step S23, the router 14 discards the received packet. In step S24, the TTL reduction unit 14i in the router 14 reduces the TTL value included in the header of the received packet. In step S25, the destination-IP-address extraction unit 14f in the router 14 extracts a destination IP address from the header of the received packet. In step S26, the path table 14g in the router 14 calculates a logical product of the acquired destination IP address and a subnet mask “255.255.255.0” in order to obtain a subnet address of a subnetwork to which a destination host belongs. In step S27, the path table 14g in the router 14 determines an input/output port corresponding to the subnet address obtained in step S26. In step S28, the ARP table 14h in the router 14 determines a MAC address corresponding to the destination IP address extracted in step S25. In step S29, the MAC-address replacement unit 14j replaces the existing destination MAC address in the packet with the MAC address determined in step S28. In step S30, the CRC re-calculation unit 14k in the router 14 re-calculates a CRC code for the packet in which the TTL value and the destination MAC address are updated. In step S31, the router 14 outputs the packet from the input/output port determined in step S27. Thus, the router 14 can transfer the packet addressed to a destination host.
FIG. 20 is a flow diagram illustrating an example of a sequence of operations performed by each of the hosts in the conventional packet transmission system of FIG. 14 when the host as a receiver host receives a packet.
In step S40, the receiver host receives a packet. In step S41, the receiver host extracts a destination MAC address from a header of the received packet. In step S42, the receiver host compares the extracted destination MAC address with the MAC address of the receiver host, and determines whether or not the received packet is addressed to the receiver host. When yes is determined in step S42, the operation goes to step S43. When no is determined in step S42, the operation goes to step S44. In step S43, the receiver host captures the received packet. In step S44, the receiver host discards the received packet. Thus, each host can receive a packet transmitted from another host.
However, in the conventional packet transmission system, it is necessary to increase the capacity of the ARP table provided in the router 14 with the number of the connected hosts. Therefore, in order to increase the capacity of the ARP table, the capacity of a storage device provided in the router 14 must be increased with the capacity of the ARP table. Thus, the cost of the router 14 increases.
In addition, when the number of registered information items increases, the search time required for searching for a requested MAC address in the ARP table increases, and therefore the processing speed decreases.
Further, the router must perform processing for replacement of the MAC address, TTL reduction, CRC re-calculation, and the like. However, regardless of whether the functions of the above processing is realized by hardware or software, the manufacturing cost of the router increases, and the packet transfer rate decreases.